package com.beilang.base.codelookup.exception;

public class CodeLookupException extends RuntimeException {

    /**
	 * 
	 */
	private static final long serialVersionUID = 7392532833019354983L;

	/**
     * Construct a <code>CodeLookupException</code>.
     *
     * @param codeType  the target code type to lookup
     * @param codeId    the target code Id to lookup
     * @param cause     the cause as message string
     */
    public CodeLookupException (String codeType, String codeId, String cause) {
        super("Error looking up [" + codeType + "]." + codeId + ": " + cause);
    }

    /**
     * Construct a <code>CodeLookupException</code>.
     *
     * @param codeType   the target code type to lookup
     * @param codeId     the target code Id to lookup
     * @param t          the underlying error
     *
     */
    public CodeLookupException (String codeType, String codeId, Throwable t) {
        super("Error looking up ["+ codeType + "]." + codeId, t);
    }

    /**
     * Construct a <code>CodeLookupException</code>.
     *
     * @param codeType  the target code type to lookup
     * @param cause     the cause as message string
     */
    public CodeLookupException (String codeType, String cause) {
        super("Error looking up [" + codeType + "]:" + cause);
    }

    /**
     * Construct a <code>CodeLookupException</code>.
     *
     * @param codeType  the target code type to lookup
     * @param t         the underlying error
     */
    public CodeLookupException (String codeType, Throwable t) {
        super("Error looking up [" + codeType + "]", t);
    }
    
    public CodeLookupException (Throwable t) {
        super("Error looking up " + t);
    }
}
